(function(){
    'use strict';

    var app = angular.module('myApp.login-module');
    
    app.factory( 'AuthEventsService', [ '$location', function( $location, $rootScope, SessionService ){
    	var authEvents = {};
    	
    	authEvents.loginSuccess = function(){
    		console.log( 'Login Success' );
    	}
    	
    	authEvents.loginFailed = function(){
    		console.log( 'Login Failed' );
    	}
    	
    	authEvents.logoutSuccess = function(){
    		console.log( 'Logged out' );
    	}
    	
    	authEvents.sessionTimeout = function(){
    		console.log( 'Session timed out' );
    	}
    	
    	authEvents.notAuthenticated = function(){
    		console.log( 'Not authenticated' );
    	}
    	
    	authEvents.notAuthorized = function(){
    		console.log( 'Not authorized' );
    		
    		$location.url( '/home' );
    	}
    	
    	return authEvents;
	} ] );

})();
